#pragma once

#include "Renderer.h"

struct LINE;
struct TEXT;

class LogoRenderer : public CRenderer
{
public:
    static HRESULT Create(IDirect3D9 *pD3D, IDirect3D9Ex *pD3DEx, HWND hwnd, UINT uAdapter, CRenderer **ppRenderer);
    ~LogoRenderer();

    HRESULT Render();
	void AddLine(FPOINT s,FPOINT e,DWORD color,float width);
	void Clear();
	void SetBackgroundColor(DWORD color);
	void AddText(FPOINT pos,DWORD color,const char* text);

protected:
    HRESULT Init(IDirect3D9 *pD3D, IDirect3D9Ex *pD3DEx, HWND hwnd, UINT uAdapter);

private:
    LogoRenderer();

    IDirect3DVertexBuffer9 *m_pd3dVB;

	CRITICAL_SECTION cs;
	LINE* lines;
	int linePoolSize;
	int currentLines;

	TEXT* texts;
	int textPoolSize;
	int currentTexts;

	bool m_bWantClearScene;
	DWORD m_backgroundColor;
	ID3DXFont*	pFont9;
	ID3DXSprite* pSprite9;
};

